#include<libavformat/avformat.h>
#include<libavutil/log.h>
#include<stdio.h>


void deleteFile(){
    char* filename = "./test_file.txt";
    int result = avpriv_io_delete(filename);
    if(result == 0){
        av_log(NULL, AV_LOG_ERROR, "delete file success\n");
    }else{
        av_log(NULL, AV_LOG_ERROR, "delete file fail\n");
    }
}

void moveFile(){
    char* filename = "./dst.txt";
    char* dst_filename = "/Users/yuanxuzhen/study/mac/ffmpeg_demo/dst.txt";
    int result = avpriv_io_move(filename, dst_filename);
    if(result == 0){
        av_log(NULL, AV_LOG_ERROR, "move file success\n");
    }else{
        av_log(NULL, AV_LOG_ERROR, "move file fail\n");
    }
}

int main(int argc, char * argv[]){
    av_log_set_level(AV_LOG_ERROR);
    deleteFile();
    moveFile();
    return 0;
}